package com.dingup.homework.service.impl;

import com.alibaba.fastjson.JSONArray;
import com.dingup.homework.bean.DO.HwSsatWordRecordDO;
import com.dingup.homework.dao.HwSsatWordRecordMapper;
import com.dingup.homework.service.HwSsatWordRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jun 2018/11/12.
 */
@Service
public class HwSsatWordRecordServiceImpl implements HwSsatWordRecordService {

    @Autowired
    private HwSsatWordRecordMapper hwSsatWordRecordMapper;

    @Override
    public Boolean add(HwSsatWordRecordDO hwSsatWordRecordDO) {
        return hwSsatWordRecordMapper.add(hwSsatWordRecordDO);
    }

    @Override
    public Boolean updateAnswerData(Integer id, String statResult, Integer correctNum, Integer totalNum, JSONArray answerData) {
        return hwSsatWordRecordMapper.updateAnswerData(id, statResult, correctNum, totalNum, answerData);
    }

    @Override
    public HwSsatWordRecordDO getByHomeworkInfo(String userId, Integer homeworkRecordId, Integer homeworkQuestionNum) {
        return hwSsatWordRecordMapper.getByHomeworkInfo(userId, homeworkRecordId, homeworkQuestionNum);
    }

    @Override
    public List<HwSsatWordRecordDO> listByHomeworkRecordId(Integer homeworkRecordId) {
        return hwSsatWordRecordMapper.listByHomeworkRecordId(homeworkRecordId);
    }
}
